package com.flashcash.kotlin.fragment.certfication

/**
 * Created by XLEO on 2018/1/19.
 */
class DataObserable<T>{
    var value:T? = null
    var mListener:DataChangeListener<T>? = null
    fun addDataChangeListener(listener:DataChangeListener<T>){
        mListener = listener
    }
    fun updateValue(t:T?){
        value = t
        mListener?.onDataChange(value)
    }
    interface DataChangeListener<T>{
        fun onDataChange(t:T?)
    }
}